from Base import message, intersect, SS_VALID
from DRG import MDCQ_DRG

def group(record):
  adrg_zd = ["T86.000","T86.000x003","T86.000x004","T86.001"]
  adrg_zd1 = []
  adrg_ss = []
  adrg_ss1 = []
  dept_list = []

  if True and record.zdList[0] in adrg_zd and (not record.ssList or not intersect(record.ssList[0],SS_VALID)):
    message('符合QR1入组条件，匹配规则：主要诊断匹配')

    if MDCQ_DRG.QR19_group(record):
      return 'QR19'
        
    return 'QR1'
  else:
    return ''
    
